Skip to content

Add Termux SSH key setup script for VPS reinstall#6

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/setup-ssh-keys-openssl-again
Draft

Add Termux SSH key setup script for VPS reinstall#6
Copilot wants to merge 2 commits intomainfrom
copilot/setup-ssh-keys-openssl-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 8, 2026

After reinstalling a VPS, Termux SSH connections break: the server's host key changes (triggering REMOTE HOST IDENTIFICATION HAS CHANGED) and the client key needs to be re-authorized. There was no tooling in the repo to handle this.

Changes

  • ssh_setup.sh (new) — end-to-end SSH reset for Termux-to-VPS:

    • Installs openssh via pkg if absent
    • Creates ~/.ssh with 700 permissions
    • Generates an Ed25519 keypair at ~/.ssh/id_ed25519 (no-op if one exists; delete to force regeneration)
    • Accepts VPS host/IP, runs ssh-keygen -R <host> to scrub the stale known_hosts entry
    • Prints the public key with ssh-copy-id one-liner and manual authorized_keys instructions
  • setup.sh — completion banner now points users to bash ssh_setup.sh

Usage

# Inside Termux, after VPS reinstall
bash ssh_setup.sh
# → installs openssh, generates key, clears stale known_hosts entry,
# → prints public key + ssh-copy-id command for the new VPS

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: marcusjenkinscode <264086284+marcusjenkinscode@users.noreply.github.com>
Copilot AI changed the title [WIP] Setup SSH keys in OpenSSL after VPS reinstall Add Termux SSH key setup script for VPS reinstall Mar 8, 2026
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants